package Q1;

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        //0-670-82162-4

        Scanner scanner = new Scanner(System.in);

        String str = scanner.next();
        char[] ch = str.toCharArray();
        int len = str.length();

        int count = 1;
        int num = 0;
        for (int i = 0; i < len - 1; i++) {
            if (ch[i] >= '0' && ch[i] <= '9') {
                num += (ch[i] - '0') * count;
                count++;
            }
        }

        if ((num % 11 == 10 ? 'X' : num % 11) == (ch[len - 1] == 'X' ? 'X' : ch[len - 1] - '0')) {
            System.out.println("Right");
        } else {
            System.out.println(str.substring(0, len - 1) + (num % 11 == 10 ? 'X' : num % 11));
        }
    }
}
